'use strict';
const Controller = require('egg').Controller;

class ProductController extends Controller {
  async list() {
    // get product list
    const { ctx } = this;
    try {
      const project = await ctx.service.project.find(
        ctx.query.current,
        ctx.query.size
      );
      ctx.body = project;
    } catch (error) {
      ctx.body = '获取失败';
      ctx.status = 500;
    }
  }
  async info() {
    // get product info
    const { ctx } = this;
    const params = ctx.params;
    ctx.body = params;
  }
}

module.exports = ProductController;
